import request from '@u/request'
import { HttpMethod } from '@u/http'

// 查询轮播图管理列表
export function listBanner(query) {
  return request({
    url: '/sys/banner/list',
    method: HttpMethod.GET,
    params: query
  })
}

// 查询轮播图管理详细
export function getBanner(id) {
  return request({
    url: '/sys/banner/' + id,
    method: HttpMethod.GET
  })
}

// 新增轮播图管理
export function addBanner(data) {
  return request({
    url: '/sys/banner',
    method: HttpMethod.POST,
    data: data
  })
}

// 修改轮播图管理
export function updateBanner(data) {
  return request({
    url: '/sys/banner',
    method: HttpMethod.PUT,
    data: data
  })
}

// 删除轮播图管理
export function delBanner(id) {
  return request({
    url: '/sys/banner/' + id,
    method: HttpMethod.DELETE
  })
}

// 轮播图状态修改
export function changeBannerStatus(bannerId, status) {
  return request({
    url: `/sys/banner/changeStatus/${bannerId}/${status}`,
    method: HttpMethod.PUT
  })
}
